<?php

namespace support\login;

class LoginFactory
{
    const GENERAL = 'password'; //账号密码登录

    const CAPTCHA = 'captcha'; //验证码登录

    public static function createInstance($loginType)
    {
        switch ($loginType) {
            case self::GENERAL:
                return new GeneralLogin();
            case self::CAPTCHA:
                return new CaptchaLogin();
            default:
                throw new \Exception('不支持的登录方式');
        }
    }
}